using MicroMsg.Common.Event;
using System;
namespace MicroMsg.Storage
{
	public class QConversationStorage : StorageMemory<QConversation, string>
	{
		public QConversationStorage() : base((QConversation c) => c.strUsrName)
		{
		}
		public bool method_5(string userName)
		{
			if (string.IsNullOrEmpty(userName))
			{
				return false;
			}
			QConversation item = base.method_0(userName);
			return base.method_2(item);
		}
		public bool setUnreadCount(string userName, int nUnReadCount, bool forcetoReaded = false)
		{
			if (string.IsNullOrEmpty(userName))
			{
				return false;
			}
			QConversation qConversation = base.method_0(userName);
			if (qConversation == null)
			{
				return false;
			}
			if (forcetoReaded)
			{
				qConversation.nStatus = 1;
			}
			qConversation.nUnReadCount = nUnReadCount;
			return base.modify(qConversation);
		}
		public void clearAll()
		{
			base.clear(false);
		}
		public override void notify(int operation, QConversation item)
		{
			EventCenter.postCombineEvent(EventConst.ON_STORAGE_QCONVERSATION_ADD + operation, item);
		}
	}
}
